.class final Lcom/wqmobile/sdk/pojoxml/core/a;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/wqmobile/sdk/pojoxml/core/PojoXml;


# instance fields
.field private a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

.field private b:Ljava/lang/String;

.field private c:Z


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-direct {v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;-><init>()V

    iput-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    return-void
.end method


# virtual methods
.method public final addClassAlias(Ljava/lang/Class;Ljava/lang/String;)V
    .locals 2

    if-nez p1, :cond_0

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "Provide Class type for the field alias"

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1, p2}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->addFieldAlias(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public final addCollectionClass(Ljava/lang/String;Ljava/lang/Class;)V
    .locals 2

    if-nez p2, :cond_0

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "Provide Class type for the field alias"

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v0, p1, p2}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->addCollectionClass(Ljava/lang/String;Ljava/lang/Class;)V

    return-void
.end method

.method public final addFieldAlias(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    if-nez p1, :cond_0

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "Provide Class type for the field alias"

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, "."

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1, p3}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->addFieldAlias(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public final enableCDATA(Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->c:Z

    return-void
.end method

.method public final getPojo(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
    .locals 2

    :try_start_0
    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;

    invoke-direct {v0, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;-><init>(Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v0, p1, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->parseXMLFromInputStream(Ljava/io/InputStream;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/pojoxml/util/StringUtil;->PrintExceptionStatck(Ljava/lang/Exception;)V

    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final getPojo(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
    .locals 2

    :try_start_0
    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;

    invoke-direct {v0, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;-><init>(Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v0, p1, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->parseXMLFromXmlData(Ljava/lang/String;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/pojoxml/util/StringUtil;->PrintExceptionStatck(Ljava/lang/Exception;)V

    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final getPojoFromFile(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
    .locals 2

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;

    invoke-direct {v0, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;-><init>(Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v0, p1, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->parseXMLFromFile(Ljava/lang/String;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public final getXml(Ljava/lang/Object;)Ljava/lang/String;
    .locals 2

    if-nez p1, :cond_0

    :try_start_0
    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "null value can not convert as Xml"

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/pojoxml/util/StringUtil;->PrintExceptionStatck(Ljava/lang/Exception;)V

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    :try_start_1
    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;-><init>(Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->b:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->setEncoding(Ljava/lang/String;)V

    iget-boolean v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->c:Z

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->setCDataEnabled(Z)V

    invoke-virtual {v0, p1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->getXml(Ljava/lang/Object;)Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result-object v0

    goto :goto_0
.end method

.method public final saveXml(Ljava/lang/Object;Ljava/lang/String;)V
    .locals 2

    if-nez p1, :cond_0

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "null value can not convert as Xml"

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->a:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;-><init>(Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->b:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->setEncoding(Ljava/lang/String;)V

    iget-boolean v1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->c:Z

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->setCDataEnabled(Z)V

    invoke-virtual {v0, p1, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/PojoToXml;->saveXml(Ljava/lang/Object;Ljava/lang/String;)V

    return-void
.end method

.method public final setEncoding(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/a;->b:Ljava/lang/String;

    return-void
.end method
